﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MISAPP.Classify.Service
{
    public class Squared
    {
        public string Sheet = string.Empty;
        public string[] Ranges = null;

        public Squared(string p_sheet,string[] p_ranges)
        {
            Ranges = p_ranges;
            Sheet = p_sheet;
        }

        public Squared(string p_group,string p_item,string p_amount,int p_row,string p_sheet,string p_comment)
        {
            MISGroup = p_group;
            MISItem = p_item;
            Amount = p_amount;
            RowPos = p_row.ToString();
            Sheet = p_sheet;
            Comment = p_comment;
        }

        /// <summary>
        /// for 2011 版本使用，最後一個參數給null
        /// </summary>
        /// <param name="p_shtName"></param>
        /// <param name="p_team"></param>
        /// <param name="p_userID"></param>
        /// <param name="p_pos"></param>
        /// <param name="p_cellValue"></param>
        /// <param name="p_comment"></param>
        /// <param name="p_nothing">請給null</param>
        public Squared(string p_shtName,string p_team,string p_userID
            ,string p_pos,string p_cellValue,string p_comment,object p_nothing)
        {
            Sheet = p_shtName;
            MISItem = p_team;
            MISGroup = p_userID;
            RowPos = p_pos;
            Amount = p_cellValue;
            Comment = p_comment;
        }

        /// <summary>
        /// 傳回資料陣列
        /// </summary>
        /// <returns></returns>
        public string[] GetSquared2011()
        {
            return new string[] {MISGroup,MISItem
                                 ,Amount ,"" ,RowPos
                                 ,Sheet,Comment};
        }

        /// <summary>
        /// 如果這一格是用「!」表示這一格要跳過
        /// </summary>
        /// <param name="p_range">儲存格位置EX:A1</param>
        /// <returns></returns>
        public bool IsRange(string p_range)
        {
            return !p_range.Equals("!") ? true : false;
        }

        public string MISGroup = string.Empty;
        public string MISItem = string.Empty;
        public string Amount = string.Empty;
        public string RowPos = string.Empty;
        public string Comment = string.Empty;
    }
}
